﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lisphi.Lab.PostSharpTests
{
    public class MyClass
    {
        [MyOnExceptionAspect]
        public void InvokeForMyOnExceptionAspect()
        {
            Console.WriteLine("InvokeForMyOnExceptionAspect A");
            throw new Exception("test exception.");
            Console.WriteLine("InvokeForMyOnExceptionAspect B");
        }

        [MyOnMethodBoundaryAspect]
        public void InvokeForMyOnMethodBoundaryAspect()
        {
            Console.WriteLine("InvokeForMyOnMethodBoundaryAspect A");
            //throw new Exception("test exception.");
            Console.WriteLine("InvokeForMyOnMethodBoundaryAspect B");
        }

        [MyOnMethodInvocationAspect]
        public void InvokeForMyOnMethodInvocationAspect()
        {
            Console.WriteLine("InvokeForMyOnMethodInvocationAspect A");
            //throw new Exception("test exception.");
            Console.WriteLine("InvokeForMyOnMethodInvocationAspect B");
        }

        [MyOnFieldAccessAspect]
        private int _myValue;

        public int MyValule 
        { 
            get { return this._myValue; }
            set { this._myValue = value; } 
        }
    }
}
